package com.gyj.server.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 请求接口
 * Gao
 * 2021/7/7
 */
public abstract class AbstractRequest {

    /**
     * 注册
     */
    public static final Integer REGISTER_REQUEST = 1;
    /**
     * 下线
     */
    public static final Integer CANCEL_REQUEST = 2;
    /**
     * 心跳
     */
    public static final Integer HEARTBEAT_REQUEST = 3;

    /**
     * 请求类型
     */
    protected Integer type;

    /**
     * 服务名称
     */
    protected String serviceName;
    /**
     * 服务实例id
     */
    protected String serviceInstanceId;

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getServiceInstanceId() {
        return serviceInstanceId;
    }

    public void setServiceInstanceId(String serviceInstanceId) {
        this.serviceInstanceId = serviceInstanceId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }

}
